{extend name="layout/edit" /}
{block name="content"}
<!-- form start -->
<form class="form-horizontal" action="{:url('doRechargeGemsSave')}" method="post" style="width:800px;">
    <div class="box-body">
        <div class="form-group">
            <label class="col-sm-2 control-label">我的房卡余额</label>
            <div class="col-sm-10">
                <label class="form-control-static">{$mygems}</label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">玩家ID</label>
            <div class="col-sm-10">
                <input type="text" name="userid" class="form-control input-sm" placeholder="玩家ID" required="required" data-url="{:url('user.gameuser/get_username')}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">玩家名称</label>
            <div class="col-sm-10 form-control-static" id="account">
                --
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">充值数量</label>
            <div class="col-sm-10">
                <input type="number" name="number" class="form-control input-sm" placeholder="充值数量" />
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button type="submit" class="btn btn-primary pull-right">立即充值</button>
    </div>
    <!-- /.box-footer -->
</form>
{/block}
{block name="body_foot"}
<script>
    $('input[name="userid"]').blur(function(){
        var $this=$(this);
        if(!$this.val()){
            $('#account').text('--');
        }
        $.get($this.data('url'),{'userid':$this.val()},function(data){
            $('#account').text(data);
        })
    })
    </script>
{/block}